import upmsAdminApiConfig from '@/core/upms/generated/apiconfig/upmsAdminApiConfig'
import serverApiMockUtils from '../../utils/serverApiMockUtils'
import mockProdServerUtils from '../../utils/mockUtils'
import { MockMethod } from 'vite-plugin-mock'
import Mock from 'mockjs'
import UpmsAuthorityResponse from '@/core/upms/generated/types/model/response/UpmsAuthorityResponse'

const content: UpmsAuthorityResponse[] = []
for (let i = 0; i < 10; i++) {
	content.push({
		id: i.toString(),
		upmsAppId: i.toString(),
		parentId: i.toString(),
		key: `key_权限对象_${i.toString()}`,
		title: `title_权限对象_${i.toString()}`,
		icon: `icon_权限对象_${i.toString()}`,
		sort: i,
		remark: Mock.Random.integer(1, 2) == 1 ? null : `remark_权限对象_${i.toString()}`,
		deleteFlag: '0',
		createTime: new Date().getTime().toString(),
		updateTime: new Date().getTime().toString(),
		rowVersion: 1,
	} as UpmsAuthorityResponse)
}

const mockList: MockMethod[] = [...serverApiMockUtils.getDefaultServerApi(upmsAdminApiConfig.upmsAuthority, content)]

mockProdServerUtils.addMockList(...mockList)

export const items = content
